INCLUDEPATH += $$PWD


####  Windows ### - Begin
win32{
   FFMPEG_PATH=G:/hubin/ShiftMedia/msvc
   FFMPEG_LIB_PREFIX="lib"
   FFMPEG_LIB_DEBUG="d"
   INCLUDEPATH +=  $$FFMPEG_PATH/include 

CONFIG(debug, debug|release){

    contains(QT_ARCH, i386) {
        message("32-bit")

        LIBS += $$FFMPEG_PATH/lib/x86/$${FFMPEG_LIB_PREFIX}avcodec$${FFMPEG_LIB_DEBUG}.lib \
                $$FFMPEG_PATH/lib/x86/$${FFMPEG_LIB_PREFIX}avdevice$${FFMPEG_LIB_DEBUG}.lib \
                $$FFMPEG_PATH/lib/x86/$${FFMPEG_LIB_PREFIX}avformat$${FFMPEG_LIB_DEBUG}.lib \
                $$FFMPEG_PATH/lib/x86/$${FFMPEG_LIB_PREFIX}avutil$${FFMPEG_LIB_DEBUG}.lib \
                $$FFMPEG_PATH/lib/x86/$${FFMPEG_LIB_PREFIX}avfilter$${FFMPEG_LIB_DEBUG}.lib \
                $$FFMPEG_PATH/lib/x86/$${FFMPEG_LIB_PREFIX}postproc$${FFMPEG_LIB_DEBUG}.lib \
                $$FFMPEG_PATH/lib/x86/$${FFMPEG_LIB_PREFIX}swresample$${FFMPEG_LIB_DEBUG}.lib \
                $$FFMPEG_PATH/lib/x86/$${FFMPEG_LIB_PREFIX}swscale$${FFMPEG_LIB_DEBUG}.lib

    } else {
        message("64-bit")
        LIBS += $$FFMPEG_PATH/lib/x64/$${FFMPEG_LIB_PREFIX}avcodec$${FFMPEG_LIB_DEBUG}.lib \
                $$FFMPEG_PATH/lib/x64/$${FFMPEG_LIB_PREFIX}avdevice$${FFMPEG_LIB_DEBUG}.lib \
                $$FFMPEG_PATH/lib/x64/$${FFMPEG_LIB_PREFIX}avformat$${FFMPEG_LIB_DEBUG}.lib \
                $$FFMPEG_PATH/lib/x64/$${FFMPEG_LIB_PREFIX}avutil$${FFMPEG_LIB_DEBUG}.lib \
                $$FFMPEG_PATH/lib/x64/$${FFMPEG_LIB_PREFIX}avfilter$${FFMPEG_LIB_DEBUG}.lib \
                $$FFMPEG_PATH/lib/x64/$${FFMPEG_LIB_PREFIX}postproc$${FFMPEG_LIB_DEBUG}.lib \
                $$FFMPEG_PATH/lib/x64/$${FFMPEG_LIB_PREFIX}swresample$${FFMPEG_LIB_DEBUG}.lib \
                $$FFMPEG_PATH/lib/x64/$${FFMPEG_LIB_PREFIX}swscale$${FFMPEG_LIB_DEBUG}.lib
    }
}
CONFIG(release, debug|release){

    contains(QT_ARCH, i386) {
        message("32-bit")

        LIBS += $$FFMPEG_PATH/lib/x86/avcodec.lib \
                $$FFMPEG_PATH/lib/x86/avdevice.lib \
                $$FFMPEG_PATH/lib/x86/avformat.lib \
                $$FFMPEG_PATH/lib/x86/avutil.lib \
                $$FFMPEG_PATH/lib/x86/avfilter.lib \
                $$FFMPEG_PATH/lib/x86/postproc.lib \
                $$FFMPEG_PATH/lib/x86/swresample.lib \
                $$FFMPEG_PATH/lib/x86/swscale.lib

    } else {
        message("64-bit")
        LIBS += $$FFMPEG_PATH/lib/x64/avcodec.lib \
                $$FFMPEG_PATH/lib/x64/avdevice.lib \
                $$FFMPEG_PATH/lib/x64/avformat.lib \
                $$FFMPEG_PATH/lib/x64/avutil.lib \
                $$FFMPEG_PATH/lib/x64/avfilter.lib \
                $$FFMPEG_PATH/lib/x64/postproc.lib \
                $$FFMPEG_PATH/lib/x64/swresample.lib \
                $$FFMPEG_PATH/lib/x64/swscale.lib
    }
}

#    LIBS += Strmiids.lib Shell32.lib ole32.lib OleAut32.lib Shlwapi.lib Vfw32.lib Secur32.lib
#    LIBS += Ws2_32.lib winmm.lib User32.lib advapi32.lib GDI32.lib
#    LIBS += -lws2_32 -lwinmm -lUser32 -ladvapi32 -lGDI32
#    LIBS += -llegacy_stdio_definitions

}
####  Windows  ### - End

unix{
    LIBS += -L$$FFMPEG_PATH/lib \
        -lavcodec \
        -lavdevice \
        -lavformat \
        -lavutil \
        -lswscale \
        -lswresample \
        -lavfilter
}